import request2, { downloadGet, downloadPost } from '@/utils/request2'
import { safetyApiUrl, unionApiUrl } from '@/api/config'

export default {
  findListByMain(params, data) {
    return request2({
      url: safetyApiUrl + '/rectification-notice/findListByMain',
      method: 'post',
      params, data
    })
  },
  /**
   整改通知单整改-编辑整改通知单
   */
  editByMain(params, data) {
    return request2({
      url: safetyApiUrl + '/rectification-notice/editByMain',
      method: 'post',
      params, data
    })
  },
  /**
   检查记录-查看详情
   */
  findById(params, data) {
    return request2({
      url: safetyApiUrl + '/rectification-notice/findById/' + params.id,
      method: 'get',
      params, data
    })
  },
  /**
   整改通知单整改-生成整改通知单
   */
  createByMain(params, data) {
    return request2({
      url: safetyApiUrl + '/rectification-notice/createByMain',
      method: 'post',
      params, data
    })
  },
  del(params) {
    return request2({
      url: safetyApiUrl + '/rectification-notice/deleteById/' + params.id,
      method: 'get',
      params
    })
  },
  print(params) {
    return request2({
      url: safetyApiUrl + '/rectification-notice/print/' + params.id,
      method: 'get',
      params: params
    })
  },
  printDown(params) {
    return request2({
      url: safetyApiUrl + '/rectification-notice/downLoad/' + params.id,
      method: 'get',
      params: params
    })
  },
  download(params) {
    return downloadPost(safetyApiUrl + '/rectification-notice/downLoad?id=' + params.id, {}, {}, '整改通知单.docx')
  }

}